package com.ruijixiang.leetcode.hot100;

public class leetcode0011 {
    public int maxArea(int[] height){
        int left=0,right=height.length-1,ans=0;
        while(left<right){
            ans=height[left]<height[right] ? Math.max(ans,(right-left)*height[left++]) : Math.max(ans,(right-left)*height[right--]);
        }
        return ans;
    }
}
